<?php
/**
 * Created by Benjamin.
 * Date: 2020/4/30
 * Time: 16:08
 */

namespace App\HttpController;


use EasySwoole\Http\AbstractInterface\Controller;
use EasySwoole\Http\Message\Status;

class Redis extends Controller
{
    function test(){
        go(function (){
            $redis = new \EasySwoole\Redis\Redis(new \EasySwoole\Redis\Config\RedisConfig([
                'host' => '127.0.0.1',
                'port' => '6379',
                'serialize' => \EasySwoole\Redis\Config\RedisConfig::SERIALIZE_NONE
            ]));
            var_dump($redis->set('a',1));
            var_dump($redis->get('a'));
        });

        $this->writeJson(Status::CODE_OK, ['ok'], "success");
    }
}